LinqConnect Documentation
Devart.Data.Linq Namespace / DataContext Class / ExecuteQuery Method / ExecuteQuery<TResult>(String,Object[]) Method
The SQL query to be executed.
The array of parameters to be passed to the command. Note the following behavior:

In This Topic
    ExecuteQuery<TResult>(String,Object[]) Method
    In This Topic
    Executes SQL queries directly on the database and returns objects.
    Syntax
    'Declaration
     
    Public Overloads Function ExecuteQuery(Of TResult)( _
       ByVal query As String, _
       ByVal ParamArray parameters() As Object _
    ) As IEnumerable(Of TResult)
    public IEnumerable<TResult> ExecuteQuery<TResult>( 
       string query,
       params object[] parameters
    )

    Parameters

    query
    The SQL query to be executed.
    parameters
    The array of parameters to be passed to the command. Note the following behavior:
    • If the number of objects in the array is less than the highest number identified in the command string, an exception is thrown.
    • If the array contains objects that are not referenced in the command string, no exception is thrown.
    • If any one of the parameters is null, it is converted to DBNull.Value.

    Type Parameters

    TResult

    Return Value

    IEnumerable(T), representing a list of objects returned by the query.
    Requirements

    Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

    See Also